home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / fdate44.zip / HOLIDAYS.BAT < prev    next >
DOS Batch File  |  1992-01-21  |  7KB  |  161 lines

  1. @echo off
  2. CLS
  3. goto endcomment
  4. HOLIDAYS.BAT for FDATE version 4.3a
  5. ===================================
  6. If you have any corrections to the algorithms
  7. in this batch file, please send them to Steve Ferg.
  8.  
  9. Revision history:
  10. ===================================
  11. 4.2b Jan 6, 1992
  12.      Corrected algorithm for Advent (thanks to L. Schliesser)
  13. 4.2c Jan 10, 1992
  14.      Added entry for LABOR DAY (1st Monday in Sept) (thanks to L. S.)
  15. 4.3a Jan 12, 1992
  16.      Removed all /Imm-dd-ccyy and /Od1, since those are now the default.
  17. 4.4a Jan 20, 1992
  18.      Added beginning of Black History month to demonstrate new /S
  19.      Added x'FF' in Black History month entry to demonstrate formatting
  20.  
  21. :endcomment
  22.  
  23. if not (%1)==() goto nohelp
  24. echo ───────────────────────────────────────────────────────────────────────────────
  25. echo                   HOW TO USE HOLIDAYS.BAT
  26. echo ───────────────────────────────────────────────────────────────────────────────
  27. ECHO HOLIDAYS without any parameters displays events in current year.
  28. ECHO.
  29. ECHO HOLIDAYS [year]                 displays events in [year].
  30. ECHO EXAMPLE: HOLIDAYS 1999          displays events in year 1999.
  31. ECHO.
  32. ECHO.
  33. ECHO.
  34. ECHO To print the calendar, press SHIFT+PRINTSCREEN to print each screen.
  35. ECHO.
  36. pause
  37. cls
  38. :nohelp
  39.  
  40.  
  41. rem --------------------------------------------------------
  42. rem get current year
  43. rem --------------------------------------------------------
  44. Fdate /Ff /Atoday /Occyy /P"@set year=" >junktemp.bat
  45. call junktemp.bat
  46. del  junktemp.bat
  47.  
  48.  
  49. REM if user specifies a year as parm1, use it
  50. if not (%1)==() set year=%1
  51.  
  52.  
  53. rem --------------------------------------------------------
  54. rem Determine if year is a leapyear
  55. rem AND check for validity of year parm (%1)
  56. rem --------------------------------------------------------
  57. Fdate /Ff /A01-01-%year% /Oly /P"@set LY=">junktemp.bat
  58. call junktemp.bat
  59. del  junktemp.bat
  60. if (%LY%)==(ERROR) echo Parm #1 was not a valid year: %1
  61. if (%LY%)==(ERROR) goto endit
  62.  
  63.  
  64.  
  65. echo ───────────────────────────────────────────────────────────────────────────────
  66. if (%LY%)==(0) ECHO                   EVENTS IN %YEAR%
  67. if (%LY%)==(1) ECHO                   EVENTS IN %YEAR%         Note: %year% is a leap year
  68. echo ───────────────────────────────────────────────────────────────────────────────
  69. Fdate /Ff         /A01-01-%year% /P"New Year's Day........................"
  70. Fdate /Ff         /A01-06-%year% /P"Epiphany.............................."
  71.  
  72. Fdate /Fw /D2 /N3 /A01-01-%year% /P"Martin Luther King, Jr. Day..........."
  73. Fdate /Ff /A02-01-%year% /P"    Note that " /S" begins Black History month"
  74. rem   note use of x'ff'     ^^^^ for formatting
  75. Fdate /Ff         /A02-14-%year% /P"Valentine's day......................."
  76. Fdate /Fw /D2 /N3 /A02-01-%year% /P"Presidents' Day......................."
  77. Fdate /Ff         /A03-17-%year% /P"St. Patricks's Day...................."
  78.  
  79. if (%LY%)==(1) Fdate /Ff /A02-29-%year% /P"Sadie Hawkins Day....................."
  80. set ly=
  81.  
  82. REM ========== begin: DATES TIED TO EASTER==============================
  83. set easter=
  84. if (%year%)==(1991) set easter=03-31-%year%
  85. if (%year%)==(1992) set easter=04-19-%year%
  86. if (%year%)==(1993) set easter=04-11-%year%
  87. if (%year%)==(1994) set easter=04-03-%year%
  88. if (%year%)==(1995) set easter=04-16-%year%
  89. if (%year%)==(1996) set easter=04-07-%year%
  90. if (%year%)==(1997) set easter=03-30-%year%
  91. if (%year%)==(1998) set easter=04-12-%year%
  92. if (%year%)==(1999) set easter=04-04-%year%
  93. if (%year%)==(2000) set easter=04-23-%year%
  94. if (%year%)==(2001) set easter=04-15-%year%
  95. if (%easter%)==() goto unknown
  96. echo.
  97. Fdate /Fsub /N40 /A%easter% /P"Mardi Gras (Shrove Tuesday)..........."
  98. Fdate /Fsub /N46 /A%easter% /P"Ash Wednesday (Lent begins)..........."
  99. Fdate /Fsub /N7  /A%easter% /P"Palm Sunday..........................."
  100. Fdate /Fsub /N2  /A%easter% /P"Good Friday..........................."
  101. Fdate /Ff        /A%easter% /P"Easter................................"
  102. :unknown
  103. REM ==========   end: DATES TIED TO EASTER==============================
  104.  
  105. echo ───────────────────────────────────────────────────────────────────────────────
  106. PAUSE
  107. CLS
  108.  
  109. Fdate /Fw /D4 /N4  /A04-01-%year% /P"Secretaries Day......................."
  110. Fdate /Ff          /A05-05-%year% /P"Cinco de Mayo (Mexico)................"
  111.  
  112. Fdate /Fw /D1 /N2  /A05-01-%year% /P"Mother's Day.........................."
  113. Fdate /Fw /D2 /N-1 /A05-24-%year% /P"Victoria Day (Canada)................."
  114. Fdate /FW /D2 /N-1 /A05-31-%year% /P"Memorial Day (observed)..............."
  115.  
  116. if not (%easter%)==() Fdate /Fadd /N39 /A%easter% /P"Ascension Day........................."
  117. if not (%easter%)==() Fdate /Fadd /N49 /A%easter% /P"Pentecost............................."
  118. if not (%easter%)==() echo.
  119. Fdate /Ff         /A06-14-%year% /P"Flag Day.............................."
  120. rem ----- anniversary of Bloom's Day, June 16, 1904 ------------------
  121. rem Here's a way to show an anniversary or event that you want to note.
  122. rem Thanks to L. Schliesser for the algorithm.
  123. rem ------------------------------------------------------------------
  124. Fdate /F#dif /A%year% /B1904 /P"@set ann=">junktemp.bat
  125. call junktemp.bat
  126. del junktemp.bat
  127. Fdate /Ff         /A06-16-%year% /P"Bloom's Day (%ann%th anniversary)........"
  128. rem ---------------end bloom's day --------------------------------------
  129.  
  130. Fdate /Fw /D1 /N3 /A06-01-%year% /P"Father's Day.........................."
  131. Fdate /Ff         /A07-01-%year% /P"Canada Day (Canada)..................."
  132. Fdate /Ff         /A07-04-%year% /P"Independence Day (USA)................"
  133. Fdate /Ff         /A07-14-%year% /P"Bastille Day (France)................."
  134.  
  135. rem echo ───────────────────────────────────────────────────────────────────────────────
  136. rem PAUSE
  137. rem CLS
  138.  
  139. Fdate /Fw /D2 /N1 /A09-01-%year% /P"Labor Day............................."
  140.  
  141. rem ---- begin ------- note a particular day in a particular year
  142. rem This technique is useful for noting special events:
  143. rem 21st birthdays, 50th wedding anniversaries, etc.
  144. if (%year%)==(1992) Fdate /Ff /A10-12-%year% /P"500th ann. of Columbus's discovery...."
  145. rem ----  end -------- note a particular day in a particular year
  146.  
  147. Fdate /Fw /D2 /N2  /A10-01-%year% /P"Columbus Day (observed)..............."
  148. Fdate /Ff          /A11-11-%year% /P"Veteran's Day........................."
  149.  
  150. Fdate /Fw /D5 /N4  /A11-01-%year% /P"Thanksgiving Day......................"
  151.  
  152.  
  153. Fdate /Fw /D1 /N-4 /A12-24-%year% /P"First Sunday in Advent................"
  154. Fdate /Ff          /A12-25-%year% /P"Christmas............................."
  155. Fdate /fadd /N1    /A12-31-%year% /P"New Year's Day........................"
  156. echo ───────────────────────────────────────────────────────────────────────────────
  157. :endit
  158. set year=
  159. set easter=
  160. set LY=
  161.